# $Id: PKGBUILD 84289 2013-02-15 14:50:43Z lfleischer $
# Maintainer: Lukas Fleischer <archlinux at cryptocrack dot de>
# Contributor: Pierre Chapuis <catwell at archlinux dot us>
# Contributor: Ray Kohler <ataraxia937 at gmail dot com>
# Contributor: Michael Witten <mfwitten>
# Contributor: Raphael Proust <raphlalou at gmail dot com>

pkgname=surf
pkgver=0.6
pkgrel=1
pkgdesc='A simple web browser based on WebKit/GTK+.'
arch=('i686' 'x86_64')
url='http://surf.suckless.org/'
license=('MIT')
depends=('libwebkit' 'xorg-xprop')
optdepends=('dmenu: URL-bar'
            'ca-certificates: SSL verification'
            'xterm: default download handler'
            'wget: default download handler')
makedepends=('pkgconfig')
install='surf.install'
source=("http://dl.suckless.org/${pkgname}/${pkgname}-${pkgver}.tar.gz"
        'config.h')
md5sums=('aeeed723b562a30cc6a2b3ea18f6d99a'
         '15c2c911658e2e6085e4c4fa7a7b01c1')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  cp "${srcdir}/config.h" config.h

  sed -i 's/CPPFLAGS =/CPPFLAGS +=/g' config.mk
  sed -i 's/CFLAGS =/CFLAGS +=/g' config.mk
  sed -i 's/LDFLAGS =/LDFLAGS +=/g' config.mk

  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make PREFIX=/usr DESTDIR="${pkgdir}" install
  install -Dm0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
